/**
 * 
 * @param {cookie键名} key 
 * @param {cookie键值} value 
 * @param {有效时间} time 
 */
function setCookie(key,value,time=3600){                
    document.cookie=`${key}=${value};Max-Age=${time}`;
}
/**
 * 
 * @param {cookie键名} key 
 * @returns {键名对应的键值}
 */
function getCookie(key){
    let str = document.cookie ; 
    let arr = str.split("; ");
    for( let i = 0 ; i < arr.length ; i ++ ){
        let newArr = arr[i].split("=");
        if( newArr[0] == key ){
            return newArr[1] ;
            break;
        }
    }
}
/**
 * 删除cookie中键名为key的cookie值
 * @param {cookie键名} key 
 */
function delCookie(key){
    document.cookie = `${key}=;Max-Age=-1`;
}